// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"

#include "MyNppToolbox.h"
#include "NppWraper.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
	DWORD  reasonForCall, 
	LPVOID lpReserved )
{
	switch (reasonForCall)
	{
	case DLL_PROCESS_ATTACH:
		pluginInit(hModule);
		break;

	case DLL_PROCESS_DETACH:
		//commandMenuCleanUp();
		pluginCleanUp();
		break;

	case DLL_THREAD_ATTACH:
		break;

	case DLL_THREAD_DETACH:
		break;
	}

	return TRUE;
}


extern "C" __declspec(dllexport) 
void setInfo(NppData notpadPlusData)
{
	SetNppData(notpadPlusData);
	//commandMenuInit();
}

extern "C" __declspec(dllexport) 
const TCHAR * getName()
{
	return NPP_PLUGIN_NAME;
}

extern "C" __declspec(dllexport) 
FuncItem * getFuncsArray(int *nbF)
{
	FuncItem* pFuncItem = NULL;
	GetFuncItemsArray(&pFuncItem, nbF);
	return pFuncItem;
}


extern "C" __declspec(dllexport) 
void beNotified(SCNotification* pNotify)
{
	if (pNotify->nmhdr.code == NPPN_SHUTDOWN )
	{
		CNppWindow npp(GetNppData());
	}
}


// Here you can process the Npp Messages 
// I will make the messages accessible little by little, according to the need of plugin development.
// Please let me know if you need to access to some messages :
// http://sourceforge.net/forum/forum.php?forum_id=482781
//
extern "C" __declspec(dllexport) 
	LRESULT messageProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
	//if (msg == WM_MOVE)
	//{
	//	::MessageBox(NULL, L"move", L"", MB_OK);
	//}

	return TRUE;
}

#ifdef UNICODE
extern "C" __declspec(dllexport) BOOL isUnicode()
{
	return TRUE;
}
#endif //UNICODE

